<{assign var=page_title value="管理权限组"}>
<{include file="FASHION/page_header.phtml"}>

<style>
LABEL{padding-left:6px;cursor:pointer}
.p1{margin-top:4px; border-top:1px solid #AFAFAF;}
.p2{padding-left:40px;}
.p3{padding-left:80px;}
.privbody{padding:0px 18px;}
</style>

<script language="JavaScript">
$(function(){
<{if $role.purview}>
    <{php}>
    $role = $this->get_template_vars('role');
    $this->assign('purviews', explode(',',$role['purview']));
    <{/php}>
	$.each([<{foreach item=p from=$purviews}><{$p}>,<{/foreach}>0], function(i,o){
		if(o) document.getElementsByName("pv["+o+"]")[0].checked=true;
	});
<{/if}>
	ajax_form();
});
</script>

<form  method="post" id="form1">
<table class="select">
<tr>
	<td>名称</td>
	<td><input type="text" name="name" size="20" value="<{$role.name}>" /></td>
</tr>
<tr>
	<td>说明</td>
	<td><textarea name="memo" rows=2 cols=40><{$role.memo}></textarea></td>
</tr>
<tr class="nobg">
	<td>设置权限</td>
	<td><div class="privbody">

<{foreach item=p1 from=$privs}>
<div class="p1">
	<input type="checkbox" name="pv[<{$p1.id}>]" value='1' id="pv[<{$p1.id}>]" /><label
		for="pv[<{$p1.id}>]"><{$p1.alias|default:$p1.title}></label>
</div>
<{if $p1.nodes}>
<{foreach item=p2 from=$p1.nodes}>
		<div class="p2">
		<input type="checkbox" name="pv[<{$p2.id}>]" value='1' id="pv[<{$p2.id}>]" /><label
			for="pv[<{$p2.id}>]"><{$p2.alias|default:$p2.title}></label>
		</div>
	<{if $p2.nodes}>
	<{foreach item=p3 from=$p2.nodes}>
			<div class="p3">
			<input type="checkbox" name="pv[<{$p3.id}>]" value='1' id="pv[<{$p2.id}>][<{$p3.id}>]" /><label
				for="pv[<{$p2.id}>][<{$p3.id}>]"><{$p3.alias|default:$p3.title}></label>
			</div>
	<{/foreach}>
	<{/if}>
<{/foreach}>
<{/if}>
<{/foreach}>

	</div></td>
</tr>
<tr>
	<td colspan=2 class="center">
		<input type="button" value="返 回" class="button" onclick="history.back(-1)" /> &nbsp;
		<input type="submit" value="保存信息" class="button" />
	</td>
</tr>
</table>
</form>

<{include file="FASHION/page_footer.phtml"}>
